Skip to content

Conversation

@mpaulmier
Copy link
Contributor

Hello, following our discussion on #2810 here is a PR for the changes, let me know what you think.

This actually fixes #2810 and #2811.

The function now updates the shortcuts list by searching the database for the most recently used items.

Fetching this data from the database via the existing cursor function had the side effect of getting favorite/starred items first. Which is why I also tackled #2811 in this PR as well.

The maximum number of shortcuts is now dependant on the launcher's maximum possible shortcuts and is editable during testing. This needs to be tested on actual hardware, the emulator reported 16 available slots when calling getMaxShortcutCountPerActivity which sounds a bit much to me.

I added 2 tests for the ShortcutHelper class for this new behavior. Hopefully these are useful, this part of the code wasn't tested.

Copy link
Member

@TheLastProject TheLastProject left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the general refactor feels correct, nice that it fixes 2 issues at once. Haven't tested yet, so just commenting on the general code.

Copy link
Member

@TheLastProject TheLastProject left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small things

@TheLastProject TheLastProject merged commit ace353d into CatimaLoyalty:main Jan 9, 2026
3 checks passed
@TheLastProject
Copy link
Member

This is great, thanks a lot! It worked very consistently well on my device and the code is much easier to understand now too :) Thanks for even bothering to add tests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Shortcuts not updated after archiving card

2 participants